import { createWebHistory } from 'vue-router'
export default  {
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      component: () => import(/* webpackChunkName: "main" */ '../views/index.vue'),
      children:[
        {
          path: "/home",
          component: () => import(/* webpackChunkName: "home" */ '../views/home/index.vue')
        },
        {
          path: "/search",
          component: () => import(/* webpackChunkName: "search" */ '../views/search/index.vue')
        },
        {
          path: "/setting",
          component: () => import(/* webpackChunkName: "setting" */ '../views/setting/index.vue')
        },
        {
          path: "/videoDetail",
          component: () => import(/* webpackChunkName: "videoDetail" */ '../views/videoDetail/index.vue')
        },
        {
          path: "/videoList",
          component: () => import(/* webpackChunkName: "videoList" */ '../views/videoList/index.vue')
        },
        {
          path: "/",
          redirect: { path: '/home' }
        },
      ]
    },
    {
      path: '/login',
      meta: {
        skip_auth:true
      },
      component: () => import(/* webpackChunkName: "login" */ '../views/login/index.vue'),
    },
    {
      path: '/register',
      meta: {
        skip_auth:true
      },
      component: () => import(/* webpackChunkName: "register" */ '../views/register/index.vue'),
    }
  ]
}
